import request from '@/utils/request'

// 查询订单商品列表
export function listGoods(query) {
  return request({
    url: '/system/orderGoods/list',
    method: 'get',
    params: query
  })
}

// 查询订单商品详细
export function getGoods(ordersGoodsId) {
  return request({
    url: '/system/orderGoods/' + ordersGoodsId,
    method: 'get'
  })
}

// 新增订单商品
export function addGoods(data) {
  return request({
    url: '/system/orderGoods',
    method: 'post',
    data: data
  })
}

// 修改订单商品
export function updateGoods(data) {
  return request({
    url: '/system/orderGoods',
    method: 'put',
    data: data
  })
}

// 删除订单商品
export function delGoods(ordersGoodsId) {
  return request({
    url: '/system/orderGoods/' + ordersGoodsId,
    method: 'delete'
  })
}

// 导出订单商品
export function exportGoods(query) {
  return request({
    url: '/system/orderGoods/export',
    method: 'get',
    params: query
  })
}

// 根据订单编号 查询 订单商品集合
export function getOrderGoodsList(query) {
  return request({
    url: '/system/orderGoods/orderGoodsListByOrderId?orderId='+query,
    method: 'get',
  })
}
